<?php
/**
 * Author: Hancock
 * Email: 84622365@qq.com
 * Date: 4/7/2016
 * Des: 缓存
 */
defined('INHkMvc') or exit('Access Invalid!');
class Cache{
    public static $cache;
    public static $config;
    public static function init($config){
        self::$cache = Factory::register($config['type'].'Cache', "cache");
        self::$config = $config;
    }
    public static function isWrite(){
        return self::$cache->isWrite(self::$config);
    }
    public static function write($key, $data, $time=0, $path=''){
        return self::$cache->write($key, $data, $time, $path);
    }
    public static function read($key, $path=''){
        return self::$cache->read($key, $path);
    }
}